package com.itljm.cxrMarket.mapper;

import com.itljm.cxrMarket.entity.ShoppingCart;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itljm.cxrMarket.entity.dto.ShoppingCartDTO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ShoppingCartMapper extends BaseMapper<ShoppingCart> {
    int addProductToCart(@Param("userId") Long userId, @Param("productId") Integer productId);
    int increaseProductQuantity(@Param("userId") Long userId, @Param("productId") Integer productId);
    int decreaseProductQuantity(@Param("userId") Long userId, @Param("productId") Integer productId);
    int removeProductFromCartById(@Param("userId") Long userId, @Param("productId") Integer productId);
    int removeProductFromCart(@Param("userId") Long userId, @Param("productId") Integer productId);
    int deleteCartItems(@Param("userId") Long userId, @Param("productId") Integer productId);
    List<ShoppingCartDTO> getShoppingCartItems(@Param("userId") Long userId);
    int updateCheckedStatus(Long userId, Integer productId, Integer checked);
}




